package org.spring.springboot.config.limit;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
/** @author xxw 2020.3.19 弃用
 * 检测是否限流
*/
public class RequestRateLimitUtil {

	public static boolean checkLimit() {
		HttpServletRequest request  = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
		if (request.getAttribute("RequestRateLimiter").equals("0")) {
			return false;
		}else {
			return true;
		}
		
	}
}
